package com.chance.cc.crawler.development.command.schedule.sina;

import com.chance.cc.crawler.development.command.job.domain.sina.module.SinaMedRealtimeCrawlerSchedulerJob;
import com.chance.cc.crawler.development.command.job.domain.sina.module.SinaMedTraceCrawlerSchedulerJob;
import com.chance.cc.crawler.development.command.job.domain.sina.module.SinaMpRealtimeCrawlerSchedulerJob;
import com.chance.cc.crawler.development.command.schedule.CrawlerJobScheduleCommand;

/**
 * @Author Zhao.Hhuan
 * @Date Create in 2021/1/18 14:23
 * @Description
 *      新浪
 **/
public class SinaCrawlerJobSchedule {


    private static CrawlerJobScheduleCommand crawlerJobScheduleCommand =
            new CrawlerJobScheduleCommand("192.168.1.215",9589);


    public static void main(String[] args) {
        repubflishCrawlerJobInfo(SinaMedRealtimeCrawlerSchedulerJob.publishCrawlerScheduleJobInfo().generateCrawlerTriggerKey());
        repubflishCrawlerJobInfo(SinaMedTraceCrawlerSchedulerJob.publishCrawlerScheduleJobInfo().generateCrawlerTriggerKey());
        repubflishCrawlerJobInfo(SinaMpRealtimeCrawlerSchedulerJob.publishCrawlerScheduleJobInfo().generateCrawlerTriggerKey());
//        deleteCrawlerJob(SinaMpTraceCrawlerSchedulerJob.publishCrawlerScheduleJobInfo().generateCrawlerTriggerKey());
    }

    /**
     * 重新发布调度
     * @param triggerKey
     */
    public static void repubflishCrawlerJobInfo(String triggerKey){
        crawlerJobScheduleCommand.republishCrawlerJob(triggerKey,"crawler_dev_host");
    }

    /**
     * 去除调度
     * @param triggerKey
     */
    public static void deleteCrawlerJob(String triggerKey){
        crawlerJobScheduleCommand.deleteCrawlerJob(triggerKey,"crawler_dev_host");
    }

}
